import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/userinfo_center_entity.dart';

UserinfoCenterEntity $UserinfoCenterEntityFromJson(Map<String, dynamic> json) {
  final UserinfoCenterEntity userinfoCenterEntity = UserinfoCenterEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    userinfoCenterEntity.id = id;
  }
  final String? user = jsonConvert.convert<String>(json['user']);
  if (user != null) {
    userinfoCenterEntity.user = user;
  }
  final String? rip = jsonConvert.convert<String>(json['rip']);
  if (rip != null) {
    userinfoCenterEntity.rip = rip;
  }
  final String? rdate = jsonConvert.convert<String>(json['rdate']);
  if (rdate != null) {
    userinfoCenterEntity.rdate = rdate;
  }
  final String? udid = jsonConvert.convert<String>(json['udid']);
  if (udid != null) {
    userinfoCenterEntity.udid = udid;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    userinfoCenterEntity.avatar = avatar;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    userinfoCenterEntity.nickname = nickname;
  }
  final int? money = jsonConvert.convert<int>(json['money']);
  if (money != null) {
    userinfoCenterEntity.money = money;
  }
  final int? giveMoney = jsonConvert.convert<int>(json['give_money']);
  if (giveMoney != null) {
    userinfoCenterEntity.giveMoney = giveMoney;
  }
  final int? plusExpire = jsonConvert.convert<int>(json['plus_expire']);
  if (plusExpire != null) {
    userinfoCenterEntity.plusExpire = plusExpire;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    userinfoCenterEntity.mobile = mobile;
  }
  return userinfoCenterEntity;
}

Map<String, dynamic> $UserinfoCenterEntityToJson(UserinfoCenterEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['user'] = entity.user;
  data['rip'] = entity.rip;
  data['rdate'] = entity.rdate;
  data['udid'] = entity.udid;
  data['avatar'] = entity.avatar;
  data['nickname'] = entity.nickname;
  data['money'] = entity.money;
  data['give_money'] = entity.giveMoney;
  data['plus_expire'] = entity.plusExpire;
  data['mobile'] = entity.mobile;
  return data;
}

extension UserinfoCenterEntityExtension on UserinfoCenterEntity {
  UserinfoCenterEntity copyWith({
    int? id,
    String? user,
    String? rip,
    String? rdate,
    String? udid,
    String? avatar,
    String? nickname,
    int? money,
    int? giveMoney,
    int? plusExpire,
    String? mobile,
  }) {
    return UserinfoCenterEntity()
      ..id = id ?? this.id
      ..user = user ?? this.user
      ..rip = rip ?? this.rip
      ..rdate = rdate ?? this.rdate
      ..udid = udid ?? this.udid
      ..avatar = avatar ?? this.avatar
      ..nickname = nickname ?? this.nickname
      ..money = money ?? this.money
      ..giveMoney = giveMoney ?? this.giveMoney
      ..plusExpire = plusExpire ?? this.plusExpire
      ..mobile = mobile ?? this.mobile;
  }
}